﻿using System.Collections.Generic;
using Lucene.Net.Search;

namespace TfsGiggle.Core
{
    /// <summary>
    /// Compares two Lucene docments using the doc property
    /// </summary>
    internal class ScoreDocComparer : IEqualityComparer<ScoreDoc>
    {
        public bool Equals(ScoreDoc x, ScoreDoc y)
        {
            return x.doc == y.doc;
        }

        /// <summary>
        /// Hashcode
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public int GetHashCode(ScoreDoc obj)
        {
            return obj.GetHashCode();
        }
    }
}
